const PurchaseListSearchKeys = [
  {
    key: 'purchaseCode',
    label: '采购单号',
    placeholder: '请输入采购单号',
    input: true,
    rules: [
      {
        required: false,
      },
    ],
  },
  {
    key: 'uniqueCode',
    label: '唯一码',
    placeholder: '请输入唯一码',
    input: true,
    rules: [
      {
        required: false,
      },
    ],
  },
  {
    key: 'spuCode',
    label: 'spu',
    placeholder: '请输入spu',
    input: true,
    rules: [
      {
        required: false,
      },
    ],
  },
];
const PurchaseListColumn = [
  { title: 'id', width: 100, align: 'center', dataIndex: 'id' },
  {
    title: '采购单编号',
    width: 100,
    align: 'center',
    dataIndex: 'purchaseCode',
  },
  { title: '商品数量', width: 100, align: 'center', dataIndex: 'productQty' },
  {
    title: '订单状态',
    width: 100,
    align: 'center',
    dataIndex: 'status',
    customRender: (text) => {
      return text || '--';
    },
  },
  { title: '下单时间', width: 60, align: 'center', dataIndex: 'createTime' },
];
const PurchaseExpandColumn = [
  { title: '商品信息',  width:120, align: 'center', scopedSlots: { customRender: 'onGoods' }  }, 
  { title: '系统sku', width: 100, align: 'center', dataIndex: 'sysSkuCode' },
  { title: '订单编号', width: 100, align: 'center', dataIndex: 'sysOrderNo' },

  {
    title: '采购单编号',
    width: 100,
    align: 'center',
    dataIndex: 'purchaseCode',
  },
  {
    title: '供应商',
    width: 100,
    align: 'center',
    dataIndex: 'supplySkuCode',
    customRender: (text, record) => {
      return `供应商SPU: ${record.supplySpuCode}, 供应商SKU:  ${record.supplySkuCode}`;
    },
  },
  {
    title: '商品状态',
    width: 60,
    align: 'center',
    // 商品状态 0待接单、1生产中、2待打包、3待出库、4缺图[已补图]、5取消、6拒接
    customRender: (text) => {
      return {
        0: '待接单',
        1: '生产中',
        2: '待打包',
        3: '待出库',
        4: '缺图[已补图]',
        5: '取消',
        6: '拒接',
      }[text];
    },
  },
];
const PurchaseGoogleListColumn = [
  { title: 'id', width: 80, align: 'center', dataIndex: 'id' },
  { title: '邮箱', width: 100, align: 'center', dataIndex: 'email' },
  {
    title: '授权是否有效',
    width: 140,
    align: 'center',
    dataIndex: 'valid',
    customRender: (text) => {
      return text ? '有效' : '无效';
    },
  },
];
const PurchaseModalKeys = [
  {
    key: 'name',
    label: '客户名称',
    placeholder: '客户名称',
    input: true,
    maxLength: 50,
    rules: [
      {
        required: true,
        message: '客户名称',
      },
    ],
  },
  {
    key: 'email',
    label: '客户邮箱',
    placeholder: '客户邮箱',
    input: true,
    maxLength: 50,
    rules: [
      {
        required: true,
        message: '客户邮箱',
      },
    ],
  },
  {
    key: 'status',
    label: '状态',
    placeholder: '请选择状态',
    select: true,
    rules: [
      {
        required: true,
        message: '请选择状态',
      },
    ],
  },
  {
    key: 'remark',
    label: '客户描述',
    placeholder: '简述客户描述',
    maxLength: 200,
    textarea: true,
    rules: [
      {
        required: false,
        message: '简述客户描述',
      },
    ],
  },
];

export {
  PurchaseExpandColumn,
  PurchaseGoogleListColumn,
  PurchaseListSearchKeys,
  PurchaseListColumn,
  PurchaseModalKeys,
};
